package cn.zane.designPattern.createPatterns.abstractFactoryPatterns.oldCode.application;

import cn.zane.designPattern.createPatterns.abstractFactoryPatterns.oldCode.redis.RedisUtils;

import java.util.concurrent.TimeUnit;

/**
 * @Author: zane
 * @Date: 2024/12/29
 * @Description:
 */
public class CacheServiceImpl implements CacheService {

    private final RedisUtils redisUtils = new RedisUtils();

    @Override
    public String get(String key) {
        return redisUtils.get(key);
    }

    @Override
    public void set(String key, String value) {
        redisUtils.set(key, value);
    }

    @Override
    public void setExpire(String key, String value, long timeout, TimeUnit unit) {
        redisUtils.set(key, value, timeout, unit);
    }

    @Override
    public void del(String key) {
        redisUtils.del(key);
    }
}
